package edu.nf.project.entitys.enums.storeOperation;

import lombok.Getter;

/**
 * 餐桌状态
 */
public enum BoardStatusEnum {
    /**
     * 无人
     */
    UNINHABITED(0,"无人使用"),
    /**
     * 预约
     */
    BOOKING(1,"已被预约"),
    /**
     * 就餐
     */
    REPAST(2,"正在就餐"),
    /**
     * 禁用
     */
    DISABLE(3,"已被禁用");

    @Getter
    private final Integer description;
    private final String message;

    BoardStatusEnum(Integer description, String message) {
        this.description = description;
        this.message = message;
    }

    /**
     * 根据 description 值获取对应的 message
     * @param description 状态描述值
     * @return 对应的消息，如果未找到则返回 null
     */
    public static String getMessageByDescription(Integer description) {
        for (BoardStatusEnum status : values()) {
            if (status.getDescription().equals(description)) {
                return status.message;
            }
        }
        return null;
    }

}
